package top.kaoshanji.p1ch04a;

import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.StandardOutputStreamLog;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import static org.junit.Assert.assertEquals;

/**
 * @author kaoshanji
 * ^_^
 * create time 2025/4/23 15:48
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = PerformanceConfig.class)
public class PerformanceTest {

    @Rule
    public final StandardOutputStreamLog log = new StandardOutputStreamLog();

    @Autowired
    private Performance performance;

    /**
     * 代码清单test-p1ch04a-01：测试一下Performance切点
     */
    @Test
    public void testPerformance() {
        performance.perform();
        // assertEquals("Silencing cell phones\n" + "Taking seats\n" + "Piano Solo\n" + "CLAP CLAP CLAP!!!\n", log.getLog());
    }


}
